/*
 * Material.cpp
 *
 *  Created on: 2012/07/05
 *      Author: weihe
 */

#include "Material.h"
#include <gl/glut.h>

namespace glex {

Material::Material(Color4f diffuse) :
		specular(Color4f()), diffuse(diffuse), ambient(Color4f()), emission(
				Color4f()) {
}

Material::Material(Color4f specular, Color4f diffuse, Color4f ambient,
		Color4f emission) :
		specular(specular), diffuse(diffuse), ambient(ambient), emission(
				emission) {
}

void Material::setupMaterial(int face) const {
	glMaterialfv(face, GL_SPECULAR, specular.getArray());
	glMaterialfv(face, GL_DIFFUSE, diffuse.getArray());
	glMaterialfv(face, GL_AMBIENT, ambient.getArray());
	glMaterialfv(face, GL_EMISSION, emission.getArray());
}

} /* namespace glex */

